package cn.gnp.framework.swing.app.ui;

import java.awt.Dimension;
import java.awt.Frame;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;


public class MainFrame extends JFrame {

  private static SplashScreen fSplashScreen;
  private static final String SPLASH_IMAGE = "c:/StocksMonitor.gif";

  /**
  * Show a simple graphical splash screen, as a quick preliminary to the main screen.
  */
  private static void showSplashScreen(){
    fSplashScreen = new SplashScreen(SPLASH_IMAGE);
    fSplashScreen.splash();
  }
    public void init() {
    	showSplashScreen();
		try {
		  Thread.sleep(2000);
		}
		catch(InterruptedException ex) {
		  //System.out.println(ex);
		}		
		 try {
				SwingUtilities.invokeAndWait(new Runnable(){

					public void run() {
						fSplashScreen.hide();
				        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
				        
						setSize(new Dimension(600, 400));
						
				        setVisible(true);
				        setState(Frame.NORMAL);
				        show();						 
					}
					
				});
			} catch (Exception e1) {
				//log.error(e1.getMessage(), "FSTUNK000001E", e1);
			}     	

    }
}